//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.cysyz.web.modules.base.support;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ThreadLocalContext implements Serializable {
    private static ThreadLocal threadLocalContext = new ThreadLocal();
    private Map context;

    protected ThreadLocalContext(Map context) {
        this.context = context;
    }

    public static void createNewContext() {
        threadLocalContext.set(new ThreadLocalContext(new HashMap()));
    }

    public static ThreadLocalContext getContext() {
        ThreadLocalContext context = (ThreadLocalContext) threadLocalContext.get();
        return context;
    }

    public Object get(Object key) {
        return this.context.get(key);
    }

    public void put(Object key, Object value) {
        this.context.put(key, value);
    }

    public static void remove() {
        threadLocalContext.remove();
    }
}
